package demo05;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/1 15:18
 */
public class TestJoinDemo {
    public static void main(String[] args){
        JoinDemo joinDemo = new JoinDemo();
        joinDemo.start();
        try {
            joinDemo.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"==="+i);
        }

    }
}
class JoinDemo extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"==="+i);
        }
    }
}